package bch.rocketmq.test;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ScheduledTask {

//    @Scheduled(fixedRate = 2000)
    public void scheduledTask() {
        Thread thread = Thread.currentThread();
        Thread.State state = thread.getState();
        log.info("Thread name: " + thread.getName() + ", state: " + state);
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler = thread.getUncaughtExceptionHandler();
        log.info("Thread uncaught exception handler: " + uncaughtExceptionHandler.getClass().getName());
        log.info(thread.getName() + ":This is a scheduled task");
    }
}
